Skip to content

feat: add --wait flag to compute-envs delete#593

Merged
stefanoboriero merged 5 commits intomasterfrom
fd7252-delete-wait
May 8, 2026
Merged

feat: add --wait flag to compute-envs delete#593
stefanoboriero merged 5 commits intomasterfrom
fd7252-delete-wait

Conversation

@robsyme
Copy link
Copy Markdown
Member

@robsyme robsyme commented Mar 30, 2026

Summary

  • Adds a --wait boolean flag to tw compute-envs delete
  • After the DELETE API call returns, polls describeComputeEnv() until the CE is fully removed (404) or enters ERRORED state
  • Backoff: 2s initial, +1s per poll, max 120s (matches existing waitStatus pattern)
  • Prints progress dots (suppressed in JSON output mode)
  • Prints error message if CE enters ERRORED state

Context

Forge CE deletion is async since Dec 2025 (commit be99dcf9b9). The CE stays in DELETING status for ~2 minutes while AWS resources are cleaned up. Tools like seqerakit that delete-then-recreate CEs (on_exists: overwrite) need to wait for deletion to complete before creating the replacement.

Related: FD-7252, platform#10680

Test plan

  • testDeleteWaitHappyPath: DELETE 204 -> poll DELETING -> poll 404 -> exit 0
  • testDeleteWaitErrored: DELETE 204 -> poll ERRORED -> exit 1
  • Existing delete tests unchanged (testDelete, testDeleteInvalidAuth, testDeleteNotFound)

🤖 Generated with Claude Code

@cristianrcv
Copy link
Copy Markdown
Contributor

@robsyme To my knowledge, the Tower CLI functions primarily as a direct interface to our API, so introducing additional logic or complexity at the CLI level may not be the most appropriate approach. If an external tool requires waiting for a delete operation to complete, would it not be more suitable to implement that functionality within the tool itself?

@stefanoboriero
Copy link
Copy Markdown
Contributor

While you might have a point there Cristian, this behaviour pattern is already present in tower-cli (for example in LaunchCmd https://github.com/seqeralabs/tower-cli/blob/master/src/main/java/io/seqera/tower/cli/commands/LaunchCmd.java#L90-L91) so I think having it for CE deletion as well fits the current interaction pattern between seqerakit and tower-cli

robsyme and others added 4 commits May 7, 2026 14:45
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

Signed-off-by: Rob Syme <rob.syme@gmail.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

Signed-off-by: Rob Syme <rob.syme@gmail.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

Signed-off-by: Rob Syme <rob.syme@gmail.com>
There is common logic to wait for given resource status, this commit
leverages that instead of custom logic for CE deletion.
@stefanoboriero stefanoboriero merged commit 688d7e1 into master May 8, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants